#ifndef _DICTPRODUCER_H
#define _DICTPRODUCER_H

#include "SplitTool.h"
#include <string>
#include <vector>
#include <map>

namespace wd
{

class DictProducer
{
public:
	DictProducer(const char * dir);
	DictProducer(const std::string &dir);
	DictProducer(const std::string &dir, SplitTool * splitTool);//只为中文词典

	void build_dict();
	void build_cn_dict();
	void show_files() const;
	void show_dict() const;
	void store_dict(const char *filepath);

	//void produce_cn_dict(std::map<std::string, int> &page_words);
private:
	void get_files();
	void push_dict(const std::string &word);
private:
	std::string dir_;
	std::vector<std::string> files_;
	std::map<std::string, int> dict_;
	SplitTool * splitTool_;
};

}//end of namespace wd
#endif // end DICTPRODUCER_H
